<!DOCTYPE html>
<html>
<head>
    <title>陌上</title>
    <link rel="icon" href="https://img.touxiangkong.com/zb_users/upload/2022/11/202211251669344172411383.jpg">
</head>
<body>
    <center>
<h2>登录页面</h2>

<div id="login-form">
    <label for="username">用户名：</label>
    <input type="text" id="username" name="username">
    <br>

    <label for="password">密码：</label>
    <input type="password" id="password" name="password">
    <br>

    <input type="submit" value="登录" onclick="login()">
</div>

<script>
    function login() {
        var username = document.getElementById("username").value;
        var password = document.getElementById("password").value;

        if (username === "" || password === "") {
            alert("用户名和密码不能为空！");
        } else {
            alert("登录成功！欢迎 " + username + "！");
        }
    }
</script>
</center>
</body>
</html>
